<?php
$intPage					= $objRequest->getParam('page',1);
$intCategoryId				= $objRequest->getParam('cate',0);
$intSubCategoryId			= $objRequest->getParam('sub',0);
$strKeyword					= $objRequest->getParam('keyword','');
$intCancel					= $objRequest->getParam('pcancel','');
$intLimit					= ADMIN_LIMIT;
$intOff						= ($intPage-1) * $intLimit;
$intTotal					= 0;
$arrSubCategory				= null;
$objCommon					= new Vfriend_Common();
$objProduct					= new Product(); 
$strUrl 				   .= 'cate=' . $intCategoryId . '&sub=' . $intSubCategoryId . '&';
if($strAction == 'stt') {
	$arrResult					= $objProduct->getAllStt($AppUI->type, $intType, $intCategoryId, $intSubCategoryId, $strKeyword, $intOff, $intLimit, $intTotal);
} else {
	$arrResult					= $objProduct->getAll($AppUI->type, $intType, $intCategoryId, $intSubCategoryId, $strKeyword, $intOff, $intLimit, $intTotal);
}
if($strKeyword != '') {
	$strUrl 			   .= 'keyword=' . $strKeyword . '&';
	$_SESSION['ppost']		= $objRequest->getParams();
	$_SESSION['pcancel']	= 1;
} else {
	if(isset($_SESSION['ppost'])) unset($_SESSION['ppost']);
	if(isset($_SESSION['pcancel'])) unset($_SESSION['pcancel']);
}
if($intCancel) {	
	if(isset($_SESSION['ppost'])) unset($_SESSION['ppost']);
	if(isset($_SESSION['pcancel'])) unset($_SESSION['pcancel']);
}
if($intCategoryId > 0) {
	$arrSubCategory			= $objCommon->getCategory($intCategoryId, 9);
}
$this->view->arrResult		= $arrResult;
$this->view->intTotal		= $intTotal;
$this->view->intOffset		= $intOff;
$this->view->intLimit		= $intLimit;
$this->view->strUrl			= $strUrl;
$this->view->arrCategory	= $objCommon->getCategory(0,9);
$this->view->arrSubCategory	= $arrSubCategory;
$this->view->intCategory	= $intCategoryId;
$this->view->intSubCategory	= $intSubCategoryId;
$this->view->arrType 		= $arrType;
$this->view->arrLimited 	= $arrLimited;
$this->view->arrHot 		= $arrHot;
?>